﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace LiquidFlowDemo
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        private bool isFlowing = false;
        private Storyboard waterFlowStoryboard;
        public MainWindow() {
            InitializeComponent();
            waterFlowStoryboard = (Storyboard)FindResource("WaterFlowAnimation");
        }

        private void btnStopFlow_Click(object sender, RoutedEventArgs e) {
            waterFlowStoryboard.Stop();
        }

        private void BtnToggleFlow_Click(object sender, RoutedEventArgs e) {
            waterFlowStoryboard.Begin();
        }

        private void stop_Click(object sender, RoutedEventArgs e) {
            cp1.Stop();
            cp2.Stop();
        }

        private void start_Click(object sender, RoutedEventArgs e) {
            cp1.Start();
            cp2.Start();
        }
    }
}
